package com.ysstech.common.exception;

/**
 * 业务异常
 */
public class BusinessException extends Exception {


    private int code;

    private Object args[];

    public BusinessException(Throwable e) {
        super(e);
    }

    /**
     * Constructor for BusinessException.
     *
     * @param message exception message
     */
    public BusinessException(final String message) {
        super(message);
        this.code = 0;
    }


    /**
     * Constructor for BusinessException.
     *
     * @param message exception message
     */
    public BusinessException(final int code, final String message) {
        super(message);
        this.code = code;
    }

    /**
     * Constructor for BusinessException.
     *
     * @param message exception message
     */
    public BusinessException(final String message, final Throwable cause) {
        super(message, cause);
    }


    /**
     * Constructor for BusinessException.
     *
     * @param message exception message
     */
    public BusinessException(final int code, final String message, final Object[] args) {
        super(message);
        this.code = code;
        this.args = args;
    }


    /**
     * Constructor for BusinessException.
     *
     * @param message exception message
     */
    public BusinessException(final int code, final String message, final Object[] args, final Throwable cause) {
        super(message, cause);
        this.code = code;
        this.args = args;
    }


    /**
     * @return Returns the code.
     */
    public int getCode() {
        return code;
    }


    /**
     * @param code The code to set.
     */
    public void setCode(int code) {
        this.code = code;
    }


    /**
     * @return Returns the args.
     */
    public Object[] getArgs() {
        return args;
    }


    /**
     * @param args The args to set.
     */
    public void setArgs(Object[] args) {
        this.args = args;
    }
}
